package com.xyx.ssm.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xyx.ssm.jdbcdao.syorgDao;
import com.xyx.ssm.po.SyOrg;
import com.xyx.ssm.service.SyorgService;

@Service("syorgService")
public class SyorgServiceImpl implements SyorgService {
	 @Autowired 
	 private  syorgDao syorgDao;

	@Override
	public List<Map<String, Object>> selectSyorgadd() {
		return syorgDao.selectSyorgadd();
	}

	@Override
	public int syorgadd(SyOrg syOrg) {
		// TODO Auto-generated method stub
		return syorgDao.syorgadd(syOrg);
	}

	@Override
	public int syorgupdate(SyOrg syOrg) {
		// TODO Auto-generated method stub
		return syorgDao.syorgupdate(syOrg);
	}

	@Override
	public int syorgdelete(String id) {
		int n = 0;
		String[] s = id.split(",");
		for (int i = 0; i < s.length; i++) {
			Integer id1 = Integer.parseInt(s[i]);
			n = syorgDao.syorgdelete(id1);
		}
		return n;
	}

}
